package com.ityedao.IO数据流;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class DataInputStreamTest {
    public static void main(String[] args) {
        try (
                DataInputStream dis =
                        new DataInputStream(
                                new FileInputStream("src/IO-数据流out.txt"));
        ) {
            int i = dis.readInt();
            System.out.println(i);

            double v = dis.readDouble();
            System.out.println(v);

            boolean b = dis.readBoolean();
            System.out.println(b);

            String s = dis.readUTF();
            System.out.println(s);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
